function user_create(){
	var user   = $$('user').item(0).value;
	var name   = $$('name').item(0).value;
	var pswd   = $$('pswd').item(0).value;
	var repswd = $$('repswd').item(0).value;
  	var level  = '';
	for(i=0;i<document.all.level.length;i++){
		if(document.all.level[i].checked){
			level = level + document.all.level[i].value + ",";
		}
	}		
	if (user == ''){
		alert('请输入系统帐号！');
		$$('user').item(0).focus();
		$$('user').item(0).select();
		return false;
	}
	else if (name == '')
	{
		alert('请输入真实姓名！');
		$$('name').item(0).focus();
		$$('name').item(0).select();
		return false;
	}	
	else if (pswd == '')
	{
		alert('请输入登录密码！');
        $$('pswd').item(0).focus();
        $$('pswd').item(0).select();	
		return false;
	}
	else if (pswd != repswd)
	{
		alert('密码前后不一致！');
        document.forms[0].repswd.focus();
        document.forms[0].repswd.select();	
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'admin.php?module=userCreate&action=add';
		var postdata    = 'user=' + user + '&name=' + name + '&pswd=' + pswd + '&level=' + level;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！系统帐号创建成功。');
	                    window.location.href="admin.php?module=userCreate";
		            }
	                else if(result == '101')
					{
						alert('[提示]：系统帐号已存在！请重新命名。');
	                    document.forms[0].btnSubmit.disabled = false;
						document.forms[0].user.focus();
						document.forms[0].user.select();
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;

		/*
		 * document.forms[0].action = url; document.forms[0].submit();
		 */
	}
	
	return false;
}
// ==================================================
function user_modify()
{
	var userID = document.forms[0].userID.value;
	var user   = document.forms[0].user.value;
	var name   = document.forms[0].name.value;
  	var level  = '';
	
	for(i=0;i<document.all.level.length;i++)
	{
		if(document.all.level[i].checked)
	    {
			level = level + document.all.level[i].value + ",";
		}
	}		
	
	if (user == '')
	{
		alert('请输入系统帐号！');
	    document.forms[0].user.focus();
        document.forms[0].user.select();
		return false;
	}
	else if (name == '')
	{
		alert('请输入真实姓名！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();
		return false;
	}
	else if (userID == '')
	{
		alert('必要参数获取失败！可刷新后再试。');
		window.location.href="admin.php?module=userList";
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'admin.php?module=userModify&action=modify';
		var postdata    = 'userID=' + userID + '&user=' + user + '&name=' + name + '&level=' + level;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！下属系统帐号修改成功。');
	                    window.location.href="admin.php?module=userList";
		            }
	                else if(result == '101')
					{
						alert('[提示]：系统帐号已存在！请重新命名。');
	                    document.forms[0].btnSubmit.disabled = false;
						document.forms[0].user.focus();
						document.forms[0].user.select();
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;
	}
	
	return false;
}
// ==================================================
function user_resetpswd(userID)
{
	if (msgConf())
	{
		var pswd = rnd_str(8,true,true,true); 
		
		if (pswd == '')
		{
			return false;
		}
		else if (userID == '')
		{
			return false;
		}
		else
		{
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'admin.php?module=userList&action=resetpswd';
			var postdata    = 'pswd=' + pswd + '&userID=' + userID;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：新密码已复制在剪贴板内。');
							window.clipboardData.setData("Text","系统帐号编号:"+userID+"\n新的登录密码:"+pswd);
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function rnd_str(str0,str1,str2,str3)
{
	var Seed_array=new Array();
	var seedary;
	var i;
	
	Seed_array[0]="" 
	Seed_array[1]= "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"; 
	Seed_array[2]= "a b c d e f g h i j k l m n o p q r s t u v w x y z"; 
	Seed_array[3]= "0 1 2 3 4 5 6 7 8 9"; 
	
	if (!str1&&!str2&&!str3){str1=true;str2=true;str3=true;}
	if (str1){Seed_array[0]+=Seed_array[1];} 
	if (str2){Seed_array[0]+=" "+Seed_array[2];} 
	if (str3){Seed_array[0]+=" "+Seed_array[3];} 
	
	Seed_array[0] = Seed_array[0].split(" "); 
	seedary = "";

	for (i=0;i<str0;i++) 
	{
		seedary+=Seed_array[0][Math.round(Math.random( )*(Seed_array[0].length-1))] 
	}
	
	return(seedary);
}
// ==================================================
function user_modifypswd()
{
	var userID  = document.forms[0].userID.value;
	var oldpswd = document.forms[0].oldpswd.value;
	var pswd    = $$('pswd').item(0).value;
	var repswd  = document.forms[0].repswd.value;
	var code	= document.forms[0].code.value;
	
	if (userID == '')
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (oldpswd == '')
	{
		alert('请输入原密码！');
	    document.forms[0].oldpswd.focus();
        document.forms[0].oldpswd.select();
		return false;
	}
	else if (pswd == '')
	{
		alert('请输入新密码！');
	    $$('pswd').item(0).focus();
        $$('pswd').item(0).select();
		return false;
	}
	else if (pswd.length < 6)
	{
		alert('为了系统安全新密码最少6位长度！');
	    $$('pswd').item(0).focus();
        $$('pswd').item(0).select();
		return false;
	}
	else if (repswd != pswd)
	{
		alert('密码前后不一致！');
	    document.forms[0].repswd.focus();
        document.forms[0].repswd.select();
		return false;
	}
	else if (code == '')
	{
		alert('请输入验证码！');
	    document.forms[0].code.focus();
        document.forms[0].code.select();
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;

		if (window.XMLHttpRequest)
		{
			var xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }
		
		method = 'POST';
	    var process_url = 'admin.php?module=userModifypswd&action=modifypswd';
		var postdata    = 'code=' + code + '&oldpswd=' + oldpswd + '&pswd=' + pswd + '&userID=' + userID;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：您的密码已修改成功！');
	                    window.location.href="admin.php?module=userModifypswd";
		            }
					else if (result == '101')
					{
						alert('[提示]：验证码错误！');
					    window.location.href="admin.php?module=userModifypswd";
					}
					else if (result == '102')
					{
						alert('[提示]：原密码校验失败！您无权修改密码。');
					    window.location.href="admin.php?module=userModifypswd";
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;
	}
	
	return false;
}
// ==================================================
function uin_create_single(url)
{
	var uin = document.forms[0].uin.value;
	var valiRegExp = new RegExp("^[0-9]+");

	if (!valiRegExp.test(uin) || uin.length < 5)
	{
		alert('请正确输入K秀号码！');
        document.forms[0].uin.focus();
        document.forms[0].uin.select();
		return false;
	}
	else
	{
		if (msgConf())
		{
			document.forms[0].action = url;
			document.forms[0].submit();
		}
		
	    return false;
	}
	
	return false;
}
// ==================================================
function uin_create_batch(url)
{
	var uin_s = document.forms[1].uin_s.value;
	var uin_e = document.forms[1].uin_e.value;
	var valiRegExp = new RegExp("^[0-9]+");

	if (!valiRegExp.test(uin_s))
	{
		alert('请正确输入起始号码！');
        document.forms[1].uin_s.focus();
        document.forms[1].uin_s.select();
		return false;
	}
	else if (!valiRegExp.test(uin_e))
	{
		alert('请正确输入终止号码！');
        document.forms[1].uin_e.focus();
        document.forms[1].uin_e.select();
		return false;
	}
	else if (uin_s > uin_e)
	{
		alert('请正确输入起止范围！');
        document.forms[1].uin_e.focus();
        document.forms[1].uin_e.select();
		return false;
	}
	else
	{
		if (msgConf())
		{
			document.forms[1].action = url;
			document.forms[1].submit();
		}
		
	    return false;
	}
	
	return false;
}
// ==================================================
function uin_resetpswd(uin)
{
	if (msgConf())
	{
		var pswd = rnd_str(8,true,true,true); 
		
		if (pswd == '')
		{
			return false;
		}
		else if (uin == '')
		{
			return false;
		}
		else
		{
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'core.php?module=uinList&action=resetpswd';
			var postdata    = 'pswd=' + pswd + '&uin=' + uin;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：新密码已复制在剪贴板内。');
							window.clipboardData.setData("Text","K秀帐号:"+uin+"\n新的密码:"+pswd);
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}

// ==================================================
function noticeSort_add()
{
	var name   = document.forms[0].name.value;
	var fcolor = document.forms[0].fcolor.value;	
	
	if (name == '')
	{
		alert('请输入类别名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();
		return false;
	}
	else if (fcolor == '')
	{
		alert('请输入消息颜色！');
        document.forms[0].fcolor.focus();
        document.forms[0].fcolor.select();	
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'user.php?module=noticeSortAdd&action=add';
		var postdata    = 'name=' + name + '&fcolor=' + fcolor;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！新类别添加成功。');
	                    window.location.href="user.php?module=noticeSortAdd";
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;

		/*
		 * document.forms[0].action = url; document.forms[0].submit();
		 */
	}
	
	return false;
}
// ==================================================
function noticeSort_modify()
{
	var id	    = document.forms[0].id.value;
	var name   = document.forms[0].name.value;
	var fcolor = document.forms[0].fcolor.value;	
	var valiRegExp = new RegExp("^[0-9]+");

	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试！');
		window.location.href="user.php?module=noticeSortList";
		return false;
	}
	else if (name == '')
	{
		alert('请输入类别名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();
		return false;
	}
	else if (fcolor == '')
	{
		alert('请输入消息颜色！');
        document.forms[0].fcolor.focus();
        document.forms[0].fcolor.select();	
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'user.php?module=noticeSortModify&action=modify';
		var postdata    = 'id=' + id + '&name=' + name + '&fcolor=' + fcolor;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！类别修改成功。');
	                    window.location.href="user.php?module=noticeSortList";
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;

		/*
		 * document.forms[0].action = url; document.forms[0].submit();
		 */
	}
	
	return false;
}
// ==================================================
function user_delNoticeSort(id)
{
	if (msgConf())
	{
		var valiRegExp = new RegExp("^[0-9]+");
	
		if (!valiRegExp.test(id))
		{
			return false;
		}
		else
		{
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=noticeSortList&action=del';
			var postdata    = 'id=' + id;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：删除成功。');
				            window.location.href="user.php?module=noticeSortList";
					    }
						else if(result == '101')
						{
							alert('[提示]：不能删除已有数据产生的类别！');
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function notice_add()
{
	var name    = document.forms[0].name.value;
	var sortID  = document.forms[0].sortID.value;
	var title   = document.forms[0].title.value;
	var message = document.forms[0].message.value;	

	var valiRegExp = new RegExp("^[0-9]+");
			
	if (name == '')
	{
		alert('请输入模板名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();
		return false;
	}
	else if (!valiRegExp.test(sortID))
	{
		alert('请选择所属类别！');
        document.forms[0].sortID.focus();
        document.forms[0].sortID.select();	
		return false;
	}
	else if (title == '')
	{
		alert('请输入标题模板！');
        document.forms[0].title.focus();
        document.forms[0].title.select();	
		return false;
	}
	else if (message == '')
	{
		alert('请输入内容模板！');
        document.forms[0].message.focus();
        document.forms[0].message.select();	
		return false;
	}	
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'user.php?module=noticeAdd&action=add';
		var postdata    = 'name=' + name + '&sortID=' + sortID + '&title=' + title + '&message=' + message;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！新模板添加成功。');
	                    window.location.href="user.php?module=noticeAdd";
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;

		/*
		 * document.forms[0].action = url; document.forms[0].submit();
		 */
	}
	
	return false;
}
// ==================================================
function notice_modify()
{
	var id		= document.forms[0].id.value;	
	var name    = document.forms[0].name.value;
	var sortID  = document.forms[0].sortID.value;
	var title   = document.forms[0].title.value;
	var message = document.forms[0].message.value;		

	var valiRegExp = new RegExp("^[0-9]+");
		
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;	
	}
	else if (name == '')
	{
		alert('请输入模板名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();
		return false;
	}
	else if (!valiRegExp.test(sortID))
	{
		alert('请选择所属类别！');
        document.forms[0].sortID.focus();
        document.forms[0].sortID.select();	
		return false;
	}
	else if (title == '')
	{
		alert('请输入标题模板！');
        document.forms[0].title.focus();
        document.forms[0].title.select();	
		return false;
	}
	else if (message == '')
	{
		alert('请输入内容模板！');
        document.forms[0].message.focus();
        document.forms[0].message.select();	
		return false;
	}	
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var  xmlhttp = new XMLHttpRequest();
	    }
		else if (window.ActiveXObject) 
		{
			var  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }

		method = 'POST';
	    var process_url = 'user.php?module=noticeModify&action=modify';
		var postdata    = 'id=' + id + '&name=' + name + '&sortID=' + sortID + '&title=' + title + '&message=' + message;
		
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
	        if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
	                if(result == '100')
					{
						alert('[提示]：恭喜！模板修改成功。');
	                    window.location.href="user.php?module=noticeList";
		            }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
		    }
	    }
		
		xmlhttp.open(method,process_url,true);
	    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
	    return false;

		/*
		 * document.forms[0].action = url; document.forms[0].submit();
		 */
	}
	
	return false;
}
// ==================================================
function user_delNotice(id)
{
	if (msgConf())
	{
		var valiRegExp = new RegExp("^[0-9]+");
	
		if (!valiRegExp.test(id))
		{
			return false;
		}
		else
		{
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=noticeList&action=del';
			var postdata    = 'id=' + id;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：删除成功。');
				            window.location.href="user.php?module=noticeList";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function userLevel_add()
{
	var name		= document.forms[0].name.value;
	var score	    = document.forms[0].score.value;
	var discount    = document.forms[0].discount.value;
	var favs	    = document.forms[0].favs.value;	
	var valiRegExp = new RegExp("^[0-9]+");
		
	if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的购物折扣！');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else if (!valiRegExp.test(favs))
	{
		alert('请输入能收藏K房的数量！');
	    document.forms[0].favs.focus();
        document.forms[0].favs.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=userLevelAdd&action=add';
			var postdata    = 'name=' + name + '&score=' + score + '&discount=' + discount + '&favs=' + favs;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：个人积分等级新增成功！');
				            window.location.href="user.php?module=userLevelAdd";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function singerLevel_add()
{
	var name		= document.forms[0].name.value;
	var score	    = document.forms[0].score.value;
	var discount    = document.forms[0].discount.value;
	var exchange	= document.forms[0].exchange.value;
		
	if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的表演提成率！');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else if (exchange == '')
	{
		alert('请输入达到等级后的礼物兑换率！');
	    document.forms[0].exchange.focus();
        document.forms[0].exchange.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=singerLevelAdd&action=add';
			var postdata    = 'name=' + name + '&score=' + score + '&discount=' + discount + '&exchange=' + exchange;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：歌手积分等级新增成功！');
				            window.location.href="user.php?module=singerLevelAdd";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function roomsLevel_add()
{
	var name		= document.forms[0].name.value;
	var score	    = document.forms[0].score.value;
	var discount    = document.forms[0].discount.value;
		
	if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的房主提成率！');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'rooms.php?module=roomsLevelAdd&action=add';
			var postdata    = 'name=' + name + '&score=' + score + '&discount=' + discount;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：K房积分等级新增成功！');
				            window.location.href="rooms.php?module=roomsLevelAdd";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function userLevel_modify()
{
	var id			= document.forms[0].id.value;
	var name		= document.forms[0].name.value;
	var score	    = document.forms[0].score.value;
	var discount    = document.forms[0].discount.value;
	var favs	    = document.forms[0].favs.value;	
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的购物折扣！');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else if (!valiRegExp.test(favs))
	{
		alert('请输入能收藏K房的数量！');
	    document.forms[0].favs.focus();
        document.forms[0].favs.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=userLevelModify&action=modify';
			var postdata    = 'id=' + id + '&name=' + name + '&score=' + score + '&discount=' + discount + '&favs=' + favs;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：个人积分等级修改成功！');
				            window.location.href="user.php?module=userLevelList";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function singerLevel_modify()
{
	var id			= document.forms[0].id.value;
	var name	    = document.forms[0].name.value;
	var score	   = document.forms[0].score.value;
	var discount   = document.forms[0].discount.value;
	var exchange   = document.forms[0].exchange.value;	
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的表演提成率！');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else if (exchange == '')
	{
		alert('请输入达到等级后的礼物兑换率！');
	    document.forms[0].exchange.focus();
        document.forms[0].exchange.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'user.php?module=singerLevelModify&action=modify';
			var postdata    = 'id=' + id + '&name=' + name + '&score=' + score + '&discount=' + discount + '&exchange=' + exchange;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：歌手积分等级修改成功！');
				            window.location.href="user.php?module=singerLevelList";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}

// ==================================================
function roomsLevel_modify()
{
	var id			= document.forms[0].id.value;
	var name	    = document.forms[0].name.value;
	var score	   = document.forms[0].score.value;
	var discount   = document.forms[0].discount.value;
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (score == '')
	{
		alert('请输入达到等级所需要的积分！');
	    document.forms[0].score.focus();
        document.forms[0].score.select();	
		return false;
	}
	else if (discount == '')
	{
		alert('请输入达到等级后的房主提成率');
	    document.forms[0].discount.focus();
        document.forms[0].discount.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'rooms.php?module=roomsLevelModify&action=modify';
			var postdata    = 'id=' + id + '&name=' + name + '&score=' + score + '&discount=' + discount ;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：K房积分等级修改成功！');
				            window.location.href="rooms.php?module=roomsLevelList";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function defineSort_modify()
{
	var id			= document.forms[0].id.value;
	var name	    = document.forms[0].name.value;
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (name == '')
	{
		alert('请输入业务流名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();	
		return false;
	}
	else
	{
		if (msgConf())
		{	
			document.forms[0].btnSubmit.disabled = true;
			
			if (window.XMLHttpRequest)
			{
				var xmlhttp = new XMLHttpRequest();
		    }
			else if (window.ActiveXObject) 
			{
				var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		    }
		
			method = 'POST';
		    var process_url = 'define.php?module=sortModify&action=modify';
			var postdata    = 'id=' + id + '&name=' + name;
			
			xmlhttp.onreadystatechange = function()
			{
				var result = false;
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200)
					{
						result = xmlhttp.responseText;
						// alert(result);
						if(result == '100')
						{
							alert('[提示]：业务流修改成功！');
				            window.location.href="define.php?module=sortList";
					    }
						else
						{
							alert('[提示]：系统繁忙，请稍后再试！#msg 001');
							document.forms[0].btnSubmit.disabled = false;
						}
					}
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 002');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
		    }
		
			xmlhttp.open(method,process_url,true);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xmlhttp.send(postdata);
		    return false;
		}
	}

	return false;
	
}
// ==================================================
function defineSort_add()
{
	var id	  = document.forms[0].id.value;	
	var name = document.forms[0].name.value;	
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}	
	else if (name == '')
	{
		alert('请输入业务流名称！');
	    document.forms[0].name.focus();
        document.forms[0].name.select();	
		return false;
	}
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var xmlhttp = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) 
		{
			var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		method = 'POST';
		var process_url = 'define.php?module=sortAdd&action=add';
		var postdata    = 'name=' + name;
			
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
					if(result == '100')
					{
						alert('[提示]：业务流添加成功！即将转入添加参数步骤。');
			            window.location.href="define.php?module=defineAdd&sortID="+id;
				    }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
			}
		}
		
		xmlhttp.open(method,process_url,true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
		return false;
	}

	return false;
	
}
// ==================================================
function define_add()
{
	var sortID	   = document.forms[0].sortID.value;	
	var typeID	   = document.forms[0].typeID.value;	
	var name	   = document.forms[0].name.value;	
	var value	   = document.forms[0].value.value;		
	var memo	   = document.forms[0].memo.value;
	var valiRegExp = new RegExp("^[0-9]+");
	
	if (!valiRegExp.test(sortID) || sortID == 0)
	{
		alert('请正确选择所属业务流！');
	    document.forms[0].sortID.focus();
		return false;
	}
	else if (!valiRegExp.test(typeID) || typeID == 0)
	{
		alert('请正确选择参数类型！');
	    document.forms[0].typeID.focus();
		return false;
	}
	else if (value == '')
	{
		alert('请正确输入参数数值！');
	    document.forms[0].value.focus();
        document.forms[0].value.select();	
		return false;
	}	
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var xmlhttp = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) 
		{
			var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		method = 'POST';
		var process_url = 'define.php?module=defineAdd&action=add';
		var postdata    = 'sortID=' + sortID + '&typeID=' + typeID + '&name=' + name + '&value=' + value + '&memo=' + memo;
			
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
					if(result == '100')
					{
						alert('[提示]：业务流参数添加成功！');
			            window.location.href="define.php?module=defineAdd&sortID="+sortID+"&typeID="+typeID;
				    }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
			}
		}
		
		xmlhttp.open(method,process_url,true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
		return false;
	}

	return false;
	
}
// ==================================================
function define_modify()
{	
	var id		   = document.forms[0].id.value;
	var name	   = document.forms[0].name.value;	
	var value	   = document.forms[0].value.value;		
	var memo	   = document.forms[0].memo.value;
	var valiRegExp = new RegExp("^[0-9]+");
		
	if (!valiRegExp.test(id))
	{
		alert('必要参数获取失败！可刷新后再试。');
		return false;
	}
	else if (value == '')
	{
		alert('请正确输入参数数值！');
	    document.forms[0].value.focus();
        document.forms[0].value.select();	
		return false;
	}	
	else
	{
		document.forms[0].btnSubmit.disabled = true;
		
		if (window.XMLHttpRequest)
		{
			var xmlhttp = new XMLHttpRequest();
		}
		else if (window.ActiveXObject) 
		{
			var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		method = 'POST';
		var process_url = 'define.php?module=defineModify&action=modify';
		var postdata    = 'id=' + id + '&name=' + name + '&value=' + value + '&memo=' + memo;
			
		xmlhttp.onreadystatechange = function()
		{
			var result = false;
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200)
				{
					result = xmlhttp.responseText;
					// alert(result);
					if(result == '100')
					{
						alert('[提示]：业务流参数修改成功！');
			            window.location.href="define.php?module=defineList";
				    }
					else
					{
						alert('[提示]：系统繁忙，请稍后再试！#msg 001');
						document.forms[0].btnSubmit.disabled = false;
					}
				}
				else
				{
					alert('[提示]：系统繁忙，请稍后再试！#msg 002');
					document.forms[0].btnSubmit.disabled = false;
				}
			}
		}
		
		xmlhttp.open(method,process_url,true);
		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		xmlhttp.send(postdata);
		return false;
	}

	return false;
}
